﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

public partial class admin_newsMakeHtmlAll : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            newsMakeHtmlAll();
        }
    }
    public void newsMakeHtmlAll()
    {
        DataTable dt=DB.getDataTable("select * from news");
        if (dt != null && dt.Rows.Count > 0) {
            for (int i = 0; i < dt.Rows.Count; i++) {
                if (dt.Rows[i]["newid"] != null && dt.Rows[i]["newid"].ToString().Trim().Length > 0)
                {
                    //生成静态页面
                    MakeHtml.info(Server.MapPath("/info.htm"), dt.Rows[i]["newid"].ToString(), Server.MapPath("/info/"));
                }
            }
        }
        Response.Redirect("tree.aspx" + (Request["channelid"] != null ? "?channelid=" + Request["channelid"].ToString() : ""));
    }
}
